<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="admin/css/niceforms-default.css" />
<link rel="stylesheet" type="text/css" href="admin/css/style.css" />
<script type="text/javascript" src="admin/js/jquery.min.js"></script>
<script type="text/javascript" src="admin/js/niceforms.js"></script>
<script type="text/javascript" src="admin/js/ddaccordion.js"></script>
<script type="text/javascript" src="admin/js/jquery.jclock-1.2.0.js" ></script>
<script type="text/javascript" src="admin/js/jconfirmaction.jquery.js"></script>
<script type="text/javascript">
ddaccordion.init({
	headerclass: "submenuheader", //Shared CSS class name of headers group
	contentclass: "submenu", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "<img src='<%=basePath%>admin/images/plus.gif' class='statusicon' />", "<img src='<%=basePath%>admin/images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
});
</script>
<script type="text/javascript">
$(function($) {
    $('.jclock').jclock();
    if("success"=="${messageReturn}"){
		alert("添加成功");
	}
});

function firstPage() {
		document.queryForm.submit();
}
	
function lastPage() {
	var currentPage = <s:property value="pager.totalPage" />;
	$('#currentPage').attr('value', currentPage);
	document.queryForm.submit();
}

function backPage() {
	var currentPage = <s:property value="pager.currentPage" />;
	$('#currentPage').attr('value', currentPage-1);
	document.queryForm.submit();
}
	
function nextPage() {
	var currentPage = <s:property value="pager.currentPage" />;
	$('#currentPage').attr('value', currentPage+1);
	document.queryForm.submit();
}

function goPage() {
	var goPage = Number($('#goPage').attr('value'));
	if(isNaN(goPage)) {
		$('#goPage').attr('value', '');
		return;
	}
	$('#currentPage').attr('value', goPage);
	document.queryForm.submit();
}


</script>
</head>
<body>
<div id="main_container">
       <%@include file="../header.jsp"%>
    <div class="main_content">
        <%@include file="menu.jsp"%>
   		 <div class="center_content">  
  		  <div class="left_content">
  				  <%@include file="sidebarmenu_sys.jsp"%>
    	  </div>   
    <div class="right_content">            
        
        <h5>当前位置: 系统管理 &gt; 其他管理 &gt; 系统参数管理</h5>  
   		 <div class="form">
    		  <form name="queryForm" action="paramAction!queryParamDetailAction" method="post" class="niceform">
                <fieldset>
                    <dl>
                        <dt class="lf"><label for="pdId">参数标识：</label></dt>
                     	<dd class="inline"><input type="text" name="pdId" size="26" value="${pdId}"/></dd>
                        <dt class="lf"><label for="pdName">参数名称：</label></dt>
                      	<dd class="inline"><input type="text" name="pdName" size="26" value="${pdName}"/></dd>
                    </dl>
                    <dl>
                        <dt class="lf"><label for="pdValue"> 参 数 值  ：</label></dt>
                     	<dd class="inline"><input type="text" name="pdValue" size="26" value="${pdValue}"/></dd>
                        <dt class="lf"><label for="pdDesc"> 参数描述：</label></dt>
                      	<dd class="inline"><input type="text" name="pdDesc" size="26" value="${pdDesc}" /></dd>
                    </dl>
                    <dl>
                 		 <dd class="bt">
                 		 	<input type="hidden" id="currentPage" name="currentPage" value="1"/>
                       		<input type="submit" value="查询" />
                            <input type="button" value="添加" onclick="javascript:location.href='paramAction!queryAllTypes'" />
                       </dd>
                    </dl>
                 </fieldset>
             </form>
   		 </div> 
        
		<table id="rounded-corner">
		    <thead>
		    	<tr>
		            <th scope="col" class="rounded-company">参数类别</th>
		            <th scope="col" class="rounded">参数标识 </th>
		            <th scope="col" class="rounded">参数名称 </th>
		            <th scope="col" class="rounded">参数值 </th>
		            <th scope="col" class="rounded-q4">参数说明 </th>
		        </tr>
		    </thead>
		     <tfoot>
		    		<tr>
			        	<td class="rounded-foot-left" colspan="2">
			        	<div class="pager">
				     		共<s:property value="pager.totalSize" />条记录，
				     		当前第<s:property value="pager.currentPage" /> / <s:property value="pager.totalPage" />页
		    				</div>
			        	</td>
			        	
			        	<td colspan="3">
			        		<div class="goPage" class="rounded-foot-right">
								<a href="javascript:firstPage();">|&lt;&lt; first</a>
								<a href="javascript:backPage();"><span>&lt;&lt; prev</span></a>
								<a href="javascript:void(0)"><input type="text" name="goPage" id="goPage" value="" size="2" maxlength="4" onblur="goPage();" /></a>
								<a href="javascript:nextPage();">next &gt;&gt;</a>
								<a href="javascript:lastPage();">last &gt;&gt;|</a>
					        </div>
			        	</td>
			        	<!--<td class="rounded-foot-right">&nbsp;</td>
			        --></tr>
			    </tfoot>
		    <tbody>
		    	<c:forEach items="${pager.list}" var="pt">
			    	<tr>
			            <td>${pt.paramType.name}</td>
			            <td>${pt.paramDetailId}</td>
			            <td>${pt.name}</td>
			            <td>${pt.value}</td>
			            <td>${pt.detailDesc}</td>
			    	</tr>
		        </c:forEach>
		    </tbody>
		</table><!--

     
       	<div class="pagination">
       		<c:choose>
       			<c:when test="${pager.currentPage<=1}">
       			</c:when>
       			<c:otherwise>
       				<span class="disable"><a href="javascript:upDownPage('up');"> 上一页   </a></span>
       			</c:otherwise>
       		</c:choose>
       		<form name="pageForm" id="pageForm" action="paramAction!queryParamDetailAction" method="post">
       			<input type="hidden" value="${pdId}" name="pdId" />
       			<input type="hidden" value="${pdName}" name="pdName" />
       			<input type="hidden" value="${pdValue}" name="pdValue" />
       			<input type="hidden" value="${dDesc}" name="pdDesc" />
				<select id="currentPage" name="currentPage" onchange="pageForm.submit()">
					<c:forEach begin="1" end="${pager.totalPage}" var="index">
						<c:choose>
							<c:when test="${index == pager.currentPage}">
								<option value="${index}" selected="selected" >${index}</option>
							</c:when>
							<c:otherwise>
								<option value="${index}">${index}</option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</select>
       		</form>
       		<c:if test="${pager.currentPage<pager.totalPage}">
       			<span class=""><a href="javascript:upDownPage('down');">下一页</a></span>
       		</c:if>
       		
        </div> 
     --></div><!-- end of right content-->
            
                    
  </div>   <!--end of center content -->               
                    
          
    <div class="clear"></div>
    </div> <!--end of main content-->
	
   <%@include file="../footer.jsp" %>
      
</div>		
</body>
</html>
